#-------------------------------------------------------------------------------
#
# Copyright 2007 Luc Fourestier
#
# The copyright to the computer program(s) herein is the property of Luc
# Fourestier. The program(s) may be used and/or copied only with the written
# permission of Luc Fourestier or in accordance with the terms and conditions
# stipulated in the agreement/contract under which the program(s) have been
# supplied.
#
# Contact: luc.fourestier@gmail.com
#
#-------------------------------------------------------------------------------
#
# @file    context.s
#
#    This file implements the kernel context switch mechanism for the MIPS processor.
#
# @author  Luc Fourestier
# @version 0.1
# @date    10/2007
#
#
#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
#
# Switch from one context to another.
# C equivalent: void context_Switch(void * TaskStruct1, void * TaskStruct2);
#
# @param  TaskStruct1: the context to switch from
# @param  TaskStruct2: the context to switch to
# @return NONE.
#
#-------------------------------------------------------------------------------

    .text
	.globl	context_Switch
	.ent	context_Switch
context_Switch:
	sw	$sp,0($a0)
	sw	$fp,4($a0)
	sw	$ra,8($a0)
#	lw	$sp,0($a1)
#	lw	$fp,4($a1)
	lw	$ra,8($a1)
	j	$ra
	.end	context_Switch
	.size	context_Switch,.-context_Switch



